Redirected from "computation rule".
Contents
Idea
In type theory, a conversion rule is a rule which constrains the result of combining term introduction with term elimination. Conversion rules come in two types: beta conversion rules or computation rules, and eta conversion rules or uniqueness rules. Computation rules in particular are important, because they are used in inductive definitions. For example, the rules for addition of natural numbers has two computation rules, which derive from the two computation rules of the natural numbers type.
Moreover, conversion rules use equality. The usage of equality in this manner is called conversional equality, and in the context of beta conversion rules is also called computational equality. In type theory, there are three notions of equality, judgmental equality, propositional equality, and typal equality, all of which could be used for conversional equality.
For example, the beta conversion rule for the dependent product type could be expressed in judgmental, propositional, and typal equality:
- Judgmental beta conversion rules for dependent product types:
- Propositional beta conversion rules for dependent product types:
- Typal beta conversion rules for dependent product types:
Similarly, the eta-conversion rule for the sum type could be expressed in judgmental, propositional, and typal equality:
- Judgmental eta conversion rules for sum types:
- Propositional eta conversion rules for sum types:
- Typal eta conversion rules for sum types:
The paradigmatic example of conversional equality is a pair of terms like “” and “”, where the second is obtained by -reduction from the first. In a type theory that includes definitions by recursion, expansion of a recursor is also computational equality. For instance, if addition is defined by recursion, then “” (that is, ) reduces via this rule to “” (that is, ).
Contextual conversion rules
There are also contextual conversion rules. These differ from the usual beta-conversion rules in that in that there is an additional context member attached to the end of the context so that the full context becomes . By definition, is dependent upon , and the conclusion usually involves substituting by some given term in the context, becoming .
For example, using the example of the beta-conversion rule for the dependent product type, the contextual beta-conversion rules are given by the following:
- Judgmental contextual beta-conversion rules for dependent product types:
- Propositional contextual beta-conversion rules for dependent product types:
- Typal contextual beta-conversion rules for dependent product types:
Similarly, one could define contextual eta-conversion rules for the sum type:
- Judgmental contextual eta-conversion rules for sum types:
- Propositional contextual eta-conversion rules for sum types:
- Typal contextual eta-conversion rules for sum types:
See also
References
Contextual dependent product types and contextual identity types are defined in the appendix of:
where the computation rules are contextual computation rules.